<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>第35题</title>
    <script>
        // 用户输入
        var month = parseInt(prompt("请输入一个月份"));
        // 输出对应天数
        switch (month) {
            case 1:
            case 3:
            case 5:
            case 7:
            case 8:
            case 10:
            case 12:
                alert(year + "年的" + month + "月有31天");
                break;
            case 2:
                var year = parseInt(prompt("请输入一个年份"));
                if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {
                   alert(year + "年的" + month + "月有29天");
                } else {
                    alert(year + "年的" + month + "月有28天");
                }
                    break;
            default:
               alert(year + "年的" + month + "月有30天");
               break;
        }
    </script>
</head>
<body>
    
</body>
</html>